def isSuShu(n):
    for i in range(2,n):
        if n%i==0:
            return False
    return True

inum = num = int(input())
count = 0
if isSuShu(num):
    while num%9==0:
        num = num/9
        count +=1
    print(f"{inum}可以被{count}个9整除")
else:
    print(f"{inum}不是素数")